#ifndef ISLANDEVOLUTION_H
#define ISLANDEVOLUTION_H

#include "EvolutionEngine.h"

class IslandEvolution
{
public:
    IslandEvolution(int epochSize,int migrateSize);
    ~IslandEvolution();
    bool evolve();
    void addEvolutionEngine(EvolutionEngine* engine);
    float getFitness1();
    float getFitness2();
    float getFitness3();
    float getFitness4();
    float getFinalValue1();
    float getFinalValue2();
    float getFinalValue3();
    float getFinalValue4();
    void setTargetValue(float targetValue);
    Candidate* getWinner();
private:
    int migrateCount;
    int migrateSize;
    int epochCount;
    int epochSize;
    int epoch;
    void migrate();
    float fitness1;
    float fitness2;
    float fitness3;
    float fitness4;
    float finalValue1;
    float finalValue2;
    float finalValue3;
    float finalValue4;
    std::vector<EvolutionEngine*> evolutionEngines;
    bool finished;
};

#endif // ISLANDEVOLUTION_H
